<?php

declare(strict_types=1);

namespace app\common\service\sys;

use app\common\traits\ServiceTrait;
use app\common\dao\sys\BlackDao;

/**
 * 黑名单 服务业务层(Service)
 * @author kaige
 * @update  2022-10-19
 * @copyright ©2022 泉州市盛筑信息科技有限公司 版权所有
 */
class BlackService
{
  protected $dao = null;

  public function __construct()
  {
    $this->dao = new BlackDao();
  }
  use ServiceTrait;

  public function _list_with()
  {
    return  ['gluser'];
  }

  /**
   * 重写 输出格式化
   */
  public function _list_format($list)
  {
    if ($list && is_array($list)) {
      foreach ($list as $k => &$v) {
        $v['out_time'] =  empty($v['out_time']) ? '' : time2str($v['out_time']);
        if ($v['last_time'] && !empty($v['last_time'])) {
          $v['last_time'] = time2str($v['last_time']);
        }
      }
    }
    return $list;
  }
}
